import scrapy
from scrapy.spiders.crawl import CrawlSpider, Rule
from scrapy.linkextractors import LinkExtractor
from scrapy.http import Request


class MySpider(CrawlSpider):
    name = 'example.com'

    # allowed_domains = ['new.163.com']
    # start_urls = ['http://news.163.com/']

    def start_requests(self):
        yield Request("http://www.zol.com.cn/")

    def parse(self, response):
        yield Request("http://detail.zol.com.cn/index.php?keyword=VIVO&c=SearchList", callback=self.search_parse)

    def search_parse(self, response):
        print(response.body)
